package org.keqinglee.study.lang;

/**
 * @author: keqinglee
 * @date: 2021/11/29
 */
public class FloatTest {

    public static void main(String[] args) {

        //float强转double会有精度问题，此表达式输出0.009999999776482582
        float f = 0.01f;
        double d1 = f;
        double d2 = 0.01d;
        System.out.println(f);
        System.out.println(d1);
        System.out.println(d2);
        System.out.println(Integer.toBinaryString(Float.floatToRawIntBits(f)));
        System.out.println(Long.toBinaryString(Double.doubleToRawLongBits(d1)));
        System.out.println(Long.toBinaryString(Double.doubleToRawLongBits(d2)));
    }


}
